package com.ybzl.mini.service.impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;

import com.ybzl.mini.entity.MiniWenzhang;
import com.ybzl.mini.mapper.MiniWenzhangMapper;
import com.ybzl.mini.service.IMiniWenzhangService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import org.springframework.util.ObjectUtils;

import java.util.List;
import java.util.Map;

/*
 * Desc： 小程序文章管理列表 服务类实现
 * @Author xxx
 * @Company yb.com
 * @Since  2024-06-29
 *
 */

@Slf4j
@Service
@Transactional
public class  MiniWenzhangServiceImpl extends ServiceImpl<MiniWenzhangMapper, MiniWenzhang> implements IMiniWenzhangService {

    @Autowired
    private MiniWenzhangMapper miniWenzhangMapper;

    @Override
    public IPage<MiniWenzhang> queryPage(Integer pageNum, Integer pageSize, String id) {
        QueryWrapper<MiniWenzhang> query = new QueryWrapper<>();
            //query.select("id","name");
            if(!ObjectUtils.isEmpty(id)){
            query.eq("ID",id);
            }
            return miniWenzhangMapper.selectPage(
            new Page<>(pageNum, pageSize), query);
    }
}
